from datetime import datetime

from ext import db


class Article(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    content = db.Column(db.Text, nullable=False)
    pdatetime = db.Column(db.DateTime, default=datetime.now)
    # 外键
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)